function twoSum(nums: number[], target: number): number[] {
    let i = 0, j = nums.length - 1;
    for (let x = 0; x < nums.length; x++){
        if (nums[i] + nums[j] === target) {
            console.log([nums[i], nums[j]])
            return [nums[i], nums[j]]
        }
        if (nums[i] + nums[j] < target) {
            i++;
        } else {
            j--;
        }
    }

    return [];
};

twoSum([10,26,30,31,47,60], 40);